package com.example.dao;

import com.example.entity.Log;
import com.example.entity.Params;
import com.example.entity.Tree;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import tk.mybatis.mapper.common.Mapper;

import java.util.List;

@Repository
public interface LogDao extends Mapper<Log> {
    List<Log> findLog(@Param("params") Params params);

    @Insert("INSERT INTO log (log_id, log, logtime, username, ip)" +
            "VALUES (#{logId},#{log},#{logtime},#{username},#{ip})"
    )
    void add(Log log);

    @Delete("delete from log where log_id = #{logId}")
    void deleteById(Integer logId);
}
